﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Protoss
{
	public class ActionProducePylon : ActionProduceFromProbe
	{
		public static ActionProducePylon Instance = new ActionProducePylon();

		private ActionProducePylon() : base(25, 100, 0) { }

		public override string EventName { get { return "ActionSpawnPylon"; } }
		public override bool HaveTechnology(IBuildOrder bo) { return true; }

		public override ProtossState.ProtossBuilding GetBuilding(ProtossState state) { return state.Pylon; }

		public override void OnProductionFinished(IBuildOrder bo)
		{
			base.OnProductionFinished(bo);
			ProtossState state = bo.State as ProtossState;
			state.Supply += 8;
			state.m_SupplyBuilding -= 8;
		}

		public override void OnProductionStart(IBuildOrder bo)
		{
			base.OnProductionStart(bo);
			ProtossState state = bo.State as ProtossState;
			state.m_SupplyBuilding += 8;
		}
	}
}
